youtube search
選択した部分でyoutube の検索
code:script.js
scrapbox.PopupMenu.addButton({
title: 'youtube',
onClick: text => {
if( text.match(/^\[\S*\]$/g) ){
text = text.replace(/\[/g, '');
}else{
text = text.replace(/\[\S*/g, '');
}
text = text.replace(/\]/g, '').replace(/^\s+/, '');
let uri = encodeURI(text.replace(' ', '+'));
window.open(https://www.youtube.com/results?search_query=${uri});
}
})
#Userscript